package com.shuda.business.engine.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 验证规则DTO
 * 用于接收和返回验证规则配置数据
 * 
 * @author ink
 * @Description: 验证规则DTO
 * @date 2024-10-10 14:35:00
 */
@Data
@Schema(description = "验证规则DTO")
public class ValidationRuleDTO {

    @Schema(description = "规则ID")
    private Long id;

    @Schema(description = "规则名称", required = true)
    @NotBlank(message = "规则名称不能为空")
    private String ruleName;

    @Schema(description = "规则类型(regex-正则表达式,range-数值范围,length-长度限制,required-必填项)", required = true)
    @NotBlank(message = "规则类型不能为空")
    private String ruleType;

    @Schema(description = "规则内容(JSON格式存储)", required = true)
    @NotBlank(message = "规则内容不能为空")
    private String ruleContent;

    @Schema(description = "错误提示信息")
    private String errorMessage;

    @Schema(description = "适用字段")
    private String applicableField;

    @Schema(description = "优先级")
    @NotNull(message = "优先级不能为空")
    private Integer priority;

    @Schema(description = "状态(enabled-启用,disabled-禁用)")
    private String status;

    @Schema(description = "描述信息")
    private String description;
}